package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;



public class MainActivity extends AppCompatActivity implements View.OnClickListener  {
    @Override
    //活动第一次创建的时候会调用
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
//        ImageView imageView=(ImageView) findViewById(R.id.my_image_view);
//        Picasso.get().load("http://p1.music.126.net/2yV7awHozWl6l4I6hHdevw==/109951164478650119.jpg?param=140y140").into(imageView);
        Button btn=(Button) findViewById(R.id.send_http);
        btn.setOnClickListener(this);
        Log.d("main","onCreate");
    }

    @Override
    public void onClick(View v) {
        Intent intent=new Intent(MainActivity.this,DetailActivity.class);
        startActivity(intent);
    }

    @Override
    //活动由不可见到可见的时候会触发
    protected void onStart() {
        super.onStart();
        Log.d("main","onStart");
    }

    //活动处于栈的顶部就会触发
    @Override
    protected void onResume() {
        super.onResume();
        Log.d("main","onResume");
    }

    @Override
    protected void onPause() {
        super.onPause();
        Log.d("main","onPause");
    }

    //活动不可见的时候触发
    @Override
    protected void onStop() {
        super.onStop();
        Log.d("main","onStop");
    }
    //活动被销毁的时候触发
    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.d("main","onDestroy");
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        Log.d("main","onRestart");
    }
}
